package pat;

import java.util.Scanner;

public class B1013 {

    public static boolean Isnum(int x) {
        for (int i = 2; i <= (x / 2); i++) {
            if ((x % i) == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int M, N;
        Scanner input = new Scanner(System.in);

        M = input.nextInt();
        N = input.nextInt();

        int num[] = new int[N];

        int tmp = 2;
        int index = 0;

        while (index != N) {
            if (Isnum(tmp)) {
                num[index] = tmp;
                index++;
            }
            tmp++;
        }

        tmp = (N - M + 1) / 10;
        index = (N - M + 1) % 10;

        for (int i = 0; i < tmp; i++) {
            String str = "";
            for (int j = 0; j < 10; j++) {
                str += (num[i * 10 + j + M - 1] + " ");
            }
            System.out.println(str.substring(0, str.length() - 1));
        }

        String str = "";
        for (int i = N - index; i < N; i++) {
            str += (num[i] + " ");
        }
        System.out.print(str.substring(0, str.length() - 1));
    }
}
